﻿<?php
/**
 * @package Joomla
 * @subpackage Jmonoslideshow
 * @copyright (C) 2010 - Matthieu BARBE - www.ccomca.com
 * @license GNU/GPL v2
 * 
 * Jmonoslideshow is a Joomla extension for Monoslideshow.
 *
 * Jmonoslideshow uses :
 * Monoslideshow (http://www.monoslideshow.com/)
 * Plupload (http://www.plupload.com/) by Moxicode Systems
 * json class by Michal Migurski, Matt Knapp, Brett Stimmerman
 * jquery a JavaScript Library (http://jquery.com/)
 * getid3 library (http://getid3.sourceforge.net/)
 * swfobject is an easy-to-use and standards-friendly method to embed Flash content, which utilizes one small JavaScript file (http://code.google.com/p/swfobject/)
 * Chained Selects jQuery Plugin (http://www.appelsiini.net/2010/jquery-chained-selects)
 *
 * Jmonoslideshow is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

$doc = &JFactory::getDocument();
$params = &JComponentHelper::getParams( 'com_jmonoslideshow' );
//load css
JHTML::stylesheet( 'jmonoslideshow.css', JMONOSLIDESHOW_MEDIA_CSS_ADMIN );
JHTML::stylesheet( 'jquery-ui.custom.css', JMONOSLIDESHOW_MEDIA_CSS_ADMIN.'Aristo/' );
//load jquery
$doc->addScript(JMONOSLIDESHOW_MEDIA_JS_ADMIN.'jquery.min.js?version='.JMONOSLIDESHOW_JQUERY);

//load jquery ui
$doc->addScript(JMONOSLIDESHOW_MEDIA_JS_ADMIN.'jquery-ui.custom.min.js?version='.JMONOSLIDESHOW_JQUERYUI);
if ($params->get( 'tabsCookie', 1 ) == 1) $doc->addScript(JMONOSLIDESHOW_MEDIA_JS_ADMIN.'jquery.cookie.js?version='.JMONOSLIDESHOW_JQUERYUI);

if ($params->get( 'tabsCookie', 1 ) == 1) $cookie = "{cookie: {expires: 1}}"; else $cookie = "";
$script='

jQuery.noConflict();
jQuery(function() {
	
	
	
	
	
	
	jQuery( "#tabs-slideshow" ).tabs('.$cookie.');
	
	
	jQuery( "#global, #caption, #control, #navigation, #navigation-permanent" ).accordion({
			autoHeight: false,
			navigation: true,
			cookie: true
		});
	jQuery( ".radio" ).buttonset();
	
	
	
	jQuery( ".information" ).button({
            icons: {
                primary: "ui-icon-info"
            },
            text: false
        }).click(function() {
					
					jQuery( "#dialog-information" ).dialog( "open" );
					return false;

				});
	jQuery( "#dialog-information" ).dialog({
			autoOpen: false,
			resizable: true,
			height:380,
			width:550,
			modal: true,
			buttons: {
				"Fermer": function() {
					jQuery( this ).dialog( "close" );
				}
			}
		
		});
		
});

';

$doc = &JFactory::getDocument();									 
$doc->addScriptDeclaration($script);

$db =& JFactory::getDBO();
$nullDate 		= $db->getNullDate();
$params = &JComponentHelper::getParams( 'com_jmonoslideshow' );
jimport('joomla.environment.uri' );

?>
<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'slideshow.cancel') {
			
			Joomla.submitform(task, document.getElementById('slideshowForm'));
		}
		else
		{
			Joomla.submitform(task, document.getElementById('slideshowForm'));
		}
	}
</script>

<form action="<?php echo JRoute::_('index.php?option=com_jmonoslideshow&view=slideshow&layout=edit&id='.(int) $this->model->id); ?>" method="post" name="adminForm" id="slideshowForm" >
  <div class="col100">
  <div id="slider"></div>
    <table cellspacing="0" cellpadding="0" border="0" width="100%">
      <tr>
        <td><h3><?php echo $this->model->title;?></h3></td>
        <td><a class="information" href="javascript:;"><?php echo JText::_( 'COM_JMONOSLIDESHOW_INFORMATION' ); ?></a></td>
      </tr>
      <tr>
      
      <td colspan="2">
      
      <div id="tabs-slideshow">
      
      <ul>
        <li><a href="#slideshow-global"><?php echo JText::_( 'COM_JMONOSLIDESHOW_GLOBAL' ); ?></a></li>
        <li><a href="#slideshow-transition"><?php echo JText :: _('COM_JMONOSLIDESHOW_TRANSITION_TAB'); ?></a></li>
        <li><a href="#tabs-3"><?php echo JText :: _('COM_JMONOSLIDESHOW_CAPTION'); ?></a></li>
        <li><a href="#tabs-4"><?php echo JText :: _('COM_JMONOSLIDESHOW_CONTROL'); ?></a></li>
        <li><a href="#tabs-5"><?php echo JText :: _('COM_JMONOSLIDESHOW_NAVIGATION'); ?></a></li>
        <li><a href="#slideshow-navigation-permanent"><?php echo JText :: _('COM_JMONOSLIDESHOW_NAVIGATION_PERMANENT'); ?></a></li>
        <li><a href="#slideshow-advanced"><?php echo JText :: _('COM_JMONOSLIDESHOW_ADVANCED'); ?></a></li>
        <li><a href="#slideshow-rules"><?php echo JText :: _('COM_JMONOSLIDESHOW_RULES'); ?></a></li>
      </ul>
      <div id="slideshow-global">
        <div id="global">
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_FIRST' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
              <table><tr><td>
                <?php echo $this->form->getLabel('title'); ?></td><td> <?php echo $this->form->getInput('title'); ?></td></tr>
                <tr><td><?php echo $this->form->getLabel('description'); ?></td><td> <?php echo $this->form->getInput('description'); ?></td></tr>
              
              <?php foreach ($this->form->getFieldset('first') as $field) : ?>
             <tr><td>
              <?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_MAIN_PROPERTIES' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('global') as $field) : ?>
             <tr><td> <?php echo $field->label; ?> </td><td><?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
        
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_LINK_CONFIGURATION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
              <?php foreach ($this->form->getFieldset('link') as $field) : ?>
              <?php echo $field->label; ?> <?php echo $field->input; ?>
              <?php endforeach; ?>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_MARK' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
             <table>
              <?php foreach ($this->form->getFieldset('mark') as $field) : ?>
              <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
        </div>
      </div>
     <div id="slideshow-transition">
        <div id="transition">
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_TRANSITION_AND_EFFECT_CONFIGURATION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('effects') as $field) : ?>
               <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
     	</div>
     </div>
     
      <div id="tabs-3">
        <div id="caption">
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_CAPTION_CONFIGURATION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('caption') as $field) : ?>
               <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_CAPTION_TITLE' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('caption-title') as $field) : ?>
               <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_CAPTION_DESCRIPTION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('caption-description') as $field) : ?>
               <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
        </div>
      </div>
      <div id="tabs-4">
        <div id="control">
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_CONTROL_CONFIGURATION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('control') as $field) : ?>
               <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_ICONS_CONFIGURATION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('icons-control') as $field) : ?>
               <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_SHOW_SCRUB_BAR' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('scrub') as $field) : ?>
               <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_PROGRESS_CONTROL' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('progress') as $field) : ?>
               <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
        </div>
      </div>
      <div id="tabs-5">
        <div id="navigation">
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_NAVIGATION_CONFIGURATION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('navigation') as $field) : ?>
              <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_NAVIGATION_ITEMS_CONFIGURATION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('navigation-items') as $field) : ?>
              <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_NAVIGATION_ITEMS_HOVER_CONFIGURATION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('navigation-items-hover') as $field) : ?>
              <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
           <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_PAGE_INDICATOR' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('pageIndicator') as $field) : ?>
              <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
        </div>
      </div>
      
      <div id="slideshow-navigation-permanent">
      <div id="navigation-permanent">
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_PERMANENT_NAVIGATION' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
              <table>
			  <?php foreach ($this->form->getFieldset('permanent-navigation') as $field) : ?>
              <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
              </table>
            </fieldset>
          </div>
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_PERMANENT_NAVIGATION_ITEMS' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('permanent-navigation-items') as $field) : ?>
              <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
               </table>
            </fieldset>
          </div>
          <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_PERMANENT_NAVIGATION_ITEMS_HOVER' ); ?></a></h3>
          <div>
            <fieldset class="panelform">
            <table>
              <?php foreach ($this->form->getFieldset('permanent-navigation-items-hover') as $field) : ?>
              <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
               </table>
            </fieldset>
          </div>
      </div>
      </div>
      
      <div id="slideshow-advanced">
      
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_ADVANCED_INFO' ); ?></a></h3>
      <div>
      
      <fieldset class="panelform">
      
      <ul class="adminformlist">
        <table>
              <?php foreach ($this->form->getFieldset('advanced') as $field) : ?>
              <tr><td><?php echo $field->label; ?></td><td> <?php echo $field->input; ?></td></tr>
              <?php endforeach; ?>
               </table>
      </ul>
      </fieldset>
      </div>
      </div>
      
      <div id="slideshow-rules">
      
      <h3><a href="#"><?php echo JText::_( 'COM_JMONOSLIDESHOW_RULES' ); ?></a></h3>
      <div>
      
      <fieldset class="panelform">
      
      <ul class="adminformlist">
        <li><?php echo $this->form->getLabel('rules'); ?> <?php echo $this->form->getInput('rules'); ?></li>
      </ul>
      </fieldset>
      </div>
      </div>
      
      </td>
      
      </tr>
      
      <tr>
        <td valign="top"></td>
        <td width="450" valign="top"></td>
      </tr>
    </table>
  </div>
  <div class="clr"></div>
  <input type="hidden" name="task" value="" />
  <?php echo JHTML::_( 'form.token' ); ?>
</form>
<div id="dialog-information" title="<?php echo JText::_( 'COM_JMONOSLIDESHOW_INFORMATION' ); ?>" style="display:none;" >
  <p>
  <table>
    <tr>
      <td nowrap="nowrap"><label for="created"><?php echo JText::_('COM_JMONOSLIDESHOW_MEDIA_CREATED') ?> :</label></td>
      <td width="100%"><?php
				if ( $this->model->created == $nullDate ) {
					echo JText::_( 'COM_JMONOSLIDESHOW_NEW_MEDIA' );
				} else {
					echo JHTML::_('date',  $this->model->created,  JText::_('DATE_FORMAT_LC2') );
				}
				?></td>
    </tr>
    <tr>
      <td><label for="author"><?php echo JText::_('Author') ?> : </label></td>
      <td><?php
        $author =& JFactory::getUser($this->model->author);
		echo $author->name;
		

		?></td>
    </tr>
    <tr>
      <td nowrap="nowrap"><label for="modified"><?php echo JText::_('COM_JMONOSLIDESHOW_MEDIA_MODIFIED') ?> :</label></td>
      <td width="100%"><?php
				if ( $this->model->modified == $nullDate ) {
					echo JText::_( 'COM_JMONOSLIDESHOW_NEW_MEDIA' );
				} else {
					echo JHTML::_('date',  $this->model->modified,  JText::_('DATE_FORMAT_LC2') );
				}
				?></td>
    </tr>
    <tr>
      <td><label for="modified_by"><?php echo JText::_('COM_JMONOSLIDESHOW_MODIFIED_BY') ?> : </label></td>
      <td><?php
        $modified_by =& JFactory::getUser($this->model->modified_by);
		echo $modified_by->name;
		

		?></td>
    </tr>
    <tr>
      <td><label for="modified_by"><?php echo JText::_('COM_JMONOSLIDESHOW_DESCRIPTION') ?> : </label></td>
      <td><?php
        
		echo $this->model->description;
		

		?></td>
    </tr>
  </table>
  </p>
</div>
